﻿@model E_Learning_V3.Models.Spg
@section scripts{
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}
@using (Html.BeginForm("Edit", "Spg"))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Svarmuligheder</legend>
        <div class="editor-label">
            @Html.Label("Tilføj svarmuligheder")
        </div>
        @foreach (var item in Model.Svarmuligheder)
        {
            <div class="editor-field">
                @Html.EditorFor(m => item.svarTekst)
                @Html.ValidationMessageFor(m => item.svarTekst)
            </div>
        }
        <p>
            <input type="submit" value="Gem ny svarmulighed" />
        </p>
        @*<div class="display-field">
        <table> 
        <tr> 
            <th>Svarmulighed</th> 
            <th>Korrekt/Forkert</th> 
        </tr>
        
        @foreach (var item in Model.Svarmuligheder)
        {
            <tr> 
                <td> 
                    @Html.DisplayFor(modelItem => item.svarTekst) 
                </td> 
                <td> 
                    @if (item.korrekt == false)
                    { 
                    @Html.Label("Forkert");
                    }
                    else if (item.korrekt == true)
                    { 
                    @Html.Label("Rigtigt");
                    } 
                </td> 
            </tr> 
        }
        
    </table> 

    </div>*@
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
